Skip to content

Disable array iteration #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Disable array iteration #42

merged 1 commit into from
Jun 14, 2024

Conversation

asmeurer
Copy link
Member

@asmeurer asmeurer commented Jun 7, 2024

Fixes #41.

Copy link

@j-bowhay j-bowhay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @asmeurer for the quick fix

@asmeurer asmeurer merged commit e199357 into data-apis:main Jun 14, 2024
21 checks passed
@asmeurer
Copy link
Member Author

I do wonder if this isn't too strict. Python itself implements __iter__ using __getitem__, so technically __iter__ should work in the base array API for 1-D arrays.

OTOH, there were explicit discussions about array iteration being ambiguous, especially for higher dimensional arrays, so disallowing it is at least within the spirit of the array API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

array-api-strict creates an empty iterable rather than raising an error
2 participants